package com.yxe.service.impl;

import com.yxe.pojo.Pay;
import com.yxe.mapper.PayMapper;
import com.yxe.service.PayService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;


@Service
public class PayServiceImpl extends ServiceImpl<PayMapper, Pay> implements PayService {

    @Resource
    private PayMapper payMapper;

    @Override
    public void insert(Integer payType, Float payMoney, Integer userId) {

        payMapper.insert(payType, payMoney, LocalDateTime.now(), userId);
    }

    @Override
    public List<Pay> selectAllById(Integer userId) {
        return payMapper.selectAllById(userId);
    }

    @Override
    public List<Pay> selectAllByType(Integer userId, Integer payType) {
        return payMapper.selectAllByType(userId, payType);
    }
}
